package com.css.fxfzysx.modules.lifeline.constants;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum YeraEnum {

    YEAR1(1,"1978年以前"),
    YEAR2(2,"1978-1989年"),
    YEAR3(3,"1989-2001年"),
    YEAR4(4,"2001年以后");

    private Integer code;
    private String name;

    public static String getByCode(Integer code) {
        for (YeraEnum value : YeraEnum.values()) {
            if(code.equals(value.code)){
                return value.name;
            }
        }
        return null;
    }
}
